import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/home/index',
  },
  {
    path:'/home',
    name:'home',
    component: HomeView,
    children:[
      {
        path: 'index',
        name: 'index',
        component: () => import('../views/index/Index.vue'),
      },
      {
        path: 'serve',
        name: 'serve',
        component: () => import('../views/serve/Serve.vue'),
      },
      {
        path: 'date',
        name: 'date',
        component: () => import('../views/date/Date.vue'),
      },
      {
        path: 'me',
        name: 'me',
        component: () => import('../views/me/Me.vue'),
      },
    ]
  },
  {
    path: '/meset',
    name: 'meset',
    component: () => import('../views/me/MeSet.vue'),
    
  },
  {
    path: '/account',
    name: 'account',
    component: () => import('../views/me/Account.vue'),
    
  },
  {
    path: '/notice',
    name: 'notice',
    component: () => import('../views/me/Notice.vue'),
    
  },
  {
    path: '/chat',
    name: 'chat',
    component: () => import('../views/me/Chat.vue'),
    
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/me/About.vue'),
    
  },
  {
    path: '/shoppingcart',
    name: 'shoppingcarts',
    component: () => import('../views/me/Shopping-Cart.vue'),
    
  },
  {
    path: '/myress',
    name: 'myress',
    component: () => import('../views/me/Myress.vue'),
    
  },
  {
    path: '/address',
    name: 'address',
    component: () => import('../views/me/Address.vue'),
    
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import('../views/me/personalInformation.vue'),
  },
  {
    path: '/serve-shop/:id',
    name: 'serve-shop/:id',
    component: () => import('../views/serve/ServeShop.vue'),
  },
  {
    path: '/confirm-order/:id',
    name: 'confirm-order/:id',
    component: () => import('../views/serve/confirmOrder.vue'),
  },
  {
    path: '/appraise',
    name: 'appraise',
    component: () => import('../views/serve/Appraise.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/L-R/Login.vue'),
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/L-R/Register.vue'),
  },
  {
    path: '/forget',
    name: 'forget',
    component: () => import('../views/L-R/Forget.vue'),
  },
  {
    path:'/lotterydraw',
    name:'lotterydraw',
    component: () => import('../views/index/lottery-draw.vue'),
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('../views/index/message.vue'),
  },
  {
    path: '/conceal',
    name: 'conceal',
    component: () => import('../views/me/conceal.vue'),
  },
  // 客服中心
  {
    path: '/customer',
    name: 'customer',
    component: () => import('../views/Customer/Customer-index.vue'),
  },
  {
    path: '/propose',
    name: 'propose',
    component: () => import('../views/Customer/propose.vue'),
  },
  {
    path: '/report',
    name: 'report',
    component: () => import('../views/Customer/report.vue'),
  },
  {
    path: '/detailed',
    name: 'detailed',
    component: () => import('../views/Customer/detailed.vue'),
  },
  {
    path: '/confirmadd',
    name: 'confilrmadd',
    component: () => import('../views/me/confirmAdd.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
